// mode7.i
%module mode7
%{
//extern double ave( int n, double *array );
/*void rotate(int ** array, int ** tile, int map_size_x, int map_size_y, int tile_size_x, int tile_size_y,
	double angle, double scale);
extern void test(int ** array, int ** tile, int map_size_x, int map_size_y, int tile_size_x, int tile_size_y,
	double angle, float cx, float cy, int space_z, int horizon, double scale_x, double scale_y);*/
extern void draw_mode7(	int ** screen, const int screen_size_x, int screen_size_y,
					const int ** tilemap, const int tilemap_size_x, const int tilemap_size_y,
					const int ** tileset, const int tileset_size_x, const int tileset_size_y,
					const int tile_size_x, const int tile_size_y, const int edgetile,
					const double angle, const float cam_x, const float cam_y, const int space_z, const int horizon,
					const double scale_x, const double scale_y,
					const int anim_frame, const int fog_distace, const int fog_color);

/*extern void draw_sprites(	
							double angle, float cx, float cy, int space_z, int horizon, double scale_x, double scale_y,
							int num_sprites, int sprite_xpos, int sprite_xpos);*/
%}
%include mode7.c

/*
 %{
 #include "arrayobject.h"
 %}
 
 %init %{
 // The %init% C code is executed when the SWIG extension is imported by a program.
 // Initialize Numeric types.
 import_array();
 %}

 // Interface from a Numeric 2D unsigned short array, to plain unsigned short*.  
 %typemap(in) (unsigned short*) {
       if (!PyArray_Check($input)) 
       {
           PyErr_SetString(PyExc_TypeError,"Expected a Numeric pixel array.");
           return NULL;
       }
       PyArrayObject *array = (PyArrayObject *) $input;
       if (array->nd != 2)
       {
           PyErr_SetString(PyExc_TypeError,"Numeric pixel array must be 2D.");
           return NULL;
       }
       if (array->descr->type_num != PyArray_SHORT)
       {
           PyErr_SetString(PyExc_TypeError,"Numeric pixel array must be short type (565 pixel format).");
           return NULL;
       }
       $1 = (unsigned short*)array->data;
 }*/
